Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow one runner at a time per connection to the agent by the protocol design #773

Closed
wants to merge 6 commits into from

Conversation

jnm2
Copy link
Collaborator

@jnm2 jnm2 commented May 17, 2020

Closes #763
Contributes to #266

Review a commit at a time to follow the incremental changes.

@jnm2 jnm2 force-pushed the simplify_agent_communication branch from 2060698 to 4945ba7 Compare May 17, 2020 17:31
@jnm2 jnm2 force-pushed the simplify_agent_communication branch from 4945ba7 to 729f6cc Compare May 17, 2020 17:34
Copy link
Member

@CharliePoole CharliePoole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I'm still getting my feet wet in this iteration of the project, I'm making this a comment review.

@@ -107,7 +121,7 @@ public bool Start()
return true;
}

public override void Stop()
public void ShutDown()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agents used Stop to indicate a distinction with ShutDown, which has a special meaning for Services. Services youse StartUp and ShutDown, whereas communications elements have used Start and Stop. Where a comm element is also a service, Start and Stop are typically called as part of StartUp and ShutDown. Having these as separate methods makes some unit-testing easier.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will say, I've never been aware of that design intent! 😅

I have no strong opinion on the final naming. Joseph - re: Charlie's comment about unit testing, do you think that will cause an issue, based on your final goal here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChrisMaddock Well, to put it differently, the intent is seen in the definition of IService, which has StartUp and Shutdown methods. There is no rule against using the same method names outside of the interface, but it's potentially confusing... or maybe only confusing to me. 😄

/// </summary>
public interface ITestAgent
{
/// <summary>
/// Stops the agent, releasing any resources
/// </summary>
void Stop();
void ShutDown();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others may not be confused, but I guess I find it confusing to see an interface that implements ShutDown even though it's not an IService and which implements it without also implementing StartUp.

/// </summary>
ITestEngineRunner CreateRunner(TestPackage package);
TestEngineResult Load(TestPackage package);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading this, I feel the need to read all the code so as to see if all the methods of ITestEngineResult are present. They are, so why not just inherit from that interface?

@@ -0,0 +1,11 @@
#if NET20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not much liking the name of this class. 😄 Why not "Func.cs"?

Copy link
Member

@ChrisMaddock ChrisMaddock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Would you mind reminding me about the logic behind the change to not distinct RunAsync from Run? Thanks!

@@ -107,7 +121,7 @@ public bool Start()
return true;
}

public override void Stop()
public void ShutDown()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will say, I've never been aware of that design intent! 😅

I have no strong opinion on the final naming. Joseph - re: Charlie's comment about unit testing, do you think that will cause an issue, based on your final goal here?

/// <summary>
/// Unloads any loaded package. If none is loaded, the call is ignored.
/// </summary>
void Unload();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect your working on a minimal-change-basis here, but before we move on from this project entirely, I think we should consider if ignoring an empty Unload call rather than throwing is the behaviour we want here. It feels inconsistent with Reload's behaviour below...

Copy link
Member

@CharliePoole CharliePoole May 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChrisMaddock It could have been different, but it's public behavior. I don't think we should change what has been a safe call into one that throws.

UPDATE: Might not be public in this particular interface, but it is what we do in ITestRunner.Unload, which is public.

@ChrisMaddock
Copy link
Member

Hi Joseph,

As #774, I think this has been superceded by #937 too. Thanks again though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent protocol design: allow concurrent runners for the same agent?
3 participants